<?php require "head.html"; ?>
<?php require "side.html"; ?>

<div class="content">
    <div class="header">
        <div class="stats">
            <p class="stat"><span class="number">2014</span>年</p>
            <p class="stat"><span class="number">05</span>月</p>
            <p class="stat"><span class="number">25</span>日</p>
        </div>
        <h1 class="page-title">欢迎页</h1>
    </div>
    <div class="row-fluid">
        <div class="dialog">
            <div class="block">
               <p class="block-heading">管理员登录 </p>
                <div class="block-body">
                    <form>
                        <h5 id="err" style="color:red;"></h5>
                        <label>用户名 </label>
                        <input type="text" class="span12" id="username" name="username">
                        <label>密码</label>
                        <input type="password" class="span12" id="password" name="password">
                        <a href="javascript:void(0);" class="btn btn-primary pull-right" id="login">确认</a>
                        <!-- <label class="remember-me"><input type="checkbox"> Remember me</label> -->
                        <div class="clearfix"></div>
                    </form>
                </div>
            </div>
            <p class="pull-right" style=""> <span><strong style="color:red">用户密码都是demo</strong></span> </p>
            <p><a href="#">Forgot your password?</a></p>
        </div>
    </div>
    <script type="text/javascript">
$("[rel=tooltip]").tooltip();
$(function() {
        $('.demo-cancel-click').click(function(){return false;});
        });
function EnterPress(e){
    var e = e || window.event; 
    if(e.keyCode == 13){ 
        $('#login').click();
    } 
}   
$(function(){
   $('#login').click(function(){
      $.ajax({
         url:'/admin/login',
         type:'POST',
         data:{username:$('#username').val(),password:$('#password').val()},
         success:function(msg){
            msg_json = $.parseJSON(msg);
            if(msg_json.code>0) {
               $('#err').html(msg_json.msg);
            }
            else {
               location.href="/admin";
            }
         }
      })
   })
})
</script>
</div>

<?php require "foot.html"; ?>
